from minio import Minio
from geexin_server.settings import MINIO_SERVER_ACCESS_KEY, MINIO_SERVER_SECRET_KEY, MINIO_SERVER_HOST

class MinioSingleton:
    minio = None
    @classmethod
    def getMinioServer(clz):
        if clz.minio == None:
            # 这里我们要指定地址
            clz.minio = Minio(
                f"{MINIO_SERVER_HOST}:9000",
                access_key=MINIO_SERVER_ACCESS_KEY,
                secret_key=MINIO_SERVER_SECRET_KEY,
                secure=False
            )
        return clz.minio
